/*
 * DTOTankStatus.cpp
 *
 *  Created on: Nov 8, 2011
 *      Author: gonzalo
 */

#include "DTOTankStatus.h"



DTOTankStatus::DTOTankStatus(std::string& aDeserealizar,std::string owner) : DTO(TANK_STATUS,owner){
	deserializar(aDeserealizar);
}

DTOTankStatus::DTOTankStatus(std::string owner,int posX,int posY,int angle) : DTO(TANK_STATUS,owner){
	this->posX = posX;
	this->posY = posY;
	this->angle = angle;
}

DTOTankStatus::~DTOTankStatus() {}


std::string DTOTankStatus::serializar(){
	std::stringstream retorno;

	retorno << UtilString::TOlenghtStringStringValue(posX);
	retorno << UtilString::TOlenghtStringStringValue(posY);
	retorno << UtilString::TOlenghtStringStringValue(angle);

	return retorno.str();
}

void DTOTankStatus::deserializar(std::string& string){
	posX = UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
	posY = UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
	angle = UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
}
